package com.sdcx.agrobank.mvp.presenter;

import com.sdcx.agrobank.mvp.model.IBackModel;

import java.util.List;
import java.util.Map;

import okhttp3.MultipartBody;

public class Presenter extends IContrat.IPresenter {
    @Override
    public void post(Map<String, Object> map, List<MultipartBody.Part> list, Class aClass) {
        baseModel.post(map,list,aClass, new IBackModel() {
            @Override
            public void successful(Object object) {
                baseView.successful(object);
            }

            @Override
            public void failure(String error) {
                baseView.failure(error);
            }

        });
    }

    @Override
    public void get(Map<String, Object> map, Class aClass) {

    }


    @Override
    public void put(String url, Map<String, Object> map, Class aClass) {
        baseModel.put(url,map,aClass, new IBackModel() {
            @Override
            public void successful(Object object) {
                baseView.successful(object);
            }

            @Override
            public void failure(String error) {
                baseView.failure(error);
            }

        });
    }

    @Override
    public void delete(String url, Map<String, Object> map, Class aClass) {
        baseModel.delete(url,map,aClass, new IBackModel() {
            @Override
            public void successful(Object object) {
                baseView.successful(object);
            }

            @Override
            public void failure(String error) {
                baseView.failure(error);
            }

        });
    }

    @Override
    public void postget(Map<String, Object> map, Class aClass) {
        baseModel.postget(map,aClass, new IBackModel() {
            @Override
            public void successful(Object object) {
                baseView.successful(object);
            }

            @Override
            public void failure(String error) {
                baseView.failure(error);
            }

        });
    }

}
